#include "bk_private/bk_init.h"
#include <components/system.h>
#include <os/os.h>
#include <components/shell_task.h>
#include "cli.h"
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include "pthread.h"
#include <components/event.h>
#include <components/netif.h>
#include "time/time.h"
#include <common/bk_include.h>
#include "bk_arm_arch.h"
#include <driver/aon_rtc_types.h>
#include <string.h>
#include <driver/aon_rtc.h>
#include "components/bluetooth/bk_ble.h"
#include "components/bluetooth/bk_dm_ble.h"
#include "components/bluetooth/bk_dm_bluetooth.h"
#include "dev_common.h"
#include "bkwl_common.h"
#include "bkwl_app.h"
#include "dev_log.h"

extern void user_app_main(void);
extern void rtos_set_user_app_entry(beken_thread_function_t entry);

// extern bkwl_err_t bkwl_common_main();
void user_app_main(void)
{

	printf("\n\n\n\n\n\n\n\n\n\n");
	printf("================================\n\n");
	printf("================================\n\n");
	printf("twh  sysdev_bk entry\n\n");
	printf("================================\n\n");
	dev_log_set_level(1);
	tprintf("============tprintf lib====================\n\n");
	bkwl_common_main();
	bkwl_app_main();
	printf("twh boke normal 2\n\n");
	printf("twh user_app_main exit\n\n");
}

int main(void)
{
#if (CONFIG_SYS_CPU0)
	printf("twh boke main entry\n\n");
	rtos_set_user_app_entry((beken_thread_function_t)user_app_main);
	// bk_set_printf_sync(true);
	// shell_set_log_level(BK_LOG_WARN);
#endif
	bk_init();
	// media_service_init();
	// printf("twh main exit\n\n");

	return 0;
}